package com.ysyx.ysyx_driverorderquery.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 订单表
 * @TableName order_inf
 */
@TableName(value ="order_inf")
@Data
public class OrderPojo implements Serializable {
    /**
     * 订单id
     */
    @TableId
    private String orderId;

    /**
     * 乘客id
     */
    private Integer passengerId;

    /**
     * 司机id
     */
    private Integer driverId;

    /**
     * 起始地点名称
     */
    private String startName;

    /**
     * 终点地点名称
     */
    private String endName;

    /**
     * 里程(公里)
     */
    private Double orderMileage;

    /**
     * 费用
     */
    private Double orderCost;

    /**
     * 订单状态(101订单乘客取消、102订单被司机取消、201派单中、301行程中、401行程结束未支付、402行程结束已支付)
     */
    private Integer orderStatus;

    /**
     * 状态时间
     */
    private Date orderStatustime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OrderPojo other = (OrderPojo) that;
        return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getPassengerId() == null ? other.getPassengerId() == null : this.getPassengerId().equals(other.getPassengerId()))
            && (this.getDriverId() == null ? other.getDriverId() == null : this.getDriverId().equals(other.getDriverId()))
            && (this.getStartName() == null ? other.getStartName() == null : this.getStartName().equals(other.getStartName()))
            && (this.getEndName() == null ? other.getEndName() == null : this.getEndName().equals(other.getEndName()))
            && (this.getOrderMileage() == null ? other.getOrderMileage() == null : this.getOrderMileage().equals(other.getOrderMileage()))
            && (this.getOrderCost() == null ? other.getOrderCost() == null : this.getOrderCost().equals(other.getOrderCost()))
            && (this.getOrderStatus() == null ? other.getOrderStatus() == null : this.getOrderStatus().equals(other.getOrderStatus()))
            && (this.getOrderStatustime() == null ? other.getOrderStatustime() == null : this.getOrderStatustime().equals(other.getOrderStatustime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getPassengerId() == null) ? 0 : getPassengerId().hashCode());
        result = prime * result + ((getDriverId() == null) ? 0 : getDriverId().hashCode());
        result = prime * result + ((getStartName() == null) ? 0 : getStartName().hashCode());
        result = prime * result + ((getEndName() == null) ? 0 : getEndName().hashCode());
        result = prime * result + ((getOrderMileage() == null) ? 0 : getOrderMileage().hashCode());
        result = prime * result + ((getOrderCost() == null) ? 0 : getOrderCost().hashCode());
        result = prime * result + ((getOrderStatus() == null) ? 0 : getOrderStatus().hashCode());
        result = prime * result + ((getOrderStatustime() == null) ? 0 : getOrderStatustime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", orderId=").append(orderId);
        sb.append(", passengerId=").append(passengerId);
        sb.append(", driverId=").append(driverId);
        sb.append(", startName=").append(startName);
        sb.append(", endName=").append(endName);
        sb.append(", orderMileage=").append(orderMileage);
        sb.append(", orderCost=").append(orderCost);
        sb.append(", orderStatus=").append(orderStatus);
        sb.append(", orderStatustime=").append(orderStatustime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}